import java.util.ArrayList;
import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lily
 * Date: 2024-11-17
 * Time: 20:50
 */
public class test_2 {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     *
     * @param sc int整型二维数组
     * @return bool布尔型
     */
    public boolean hostschedule (ArrayList<ArrayList<Integer>> sc)
    {
        int m = sc.size(), n = sc.get(0).size();
        int[][] schedule = new int[m][n];
        for(int i = 0; i < m; i++)
        {
            for(int j = 0; j < n; j++)
            {
                schedule[i][j] = sc.get(i).get(j);
            }
        }
        Arrays.sort(schedule, (v1, v2) ->
        {
            return v1[0] - v2[0];
        });
        for(int i = 1; i < schedule.length; i++)
        {
            if(schedule[i][0] < schedule[i - 1][1]) return false;
        }
        return true;
    }
}
